<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    class P {
        constructor(name) {
            this.name = name
        }
    }
    class P2 extends P {
        constructor(name, age) {
            super(name, age)
            this.age = '18'
        }
    }

    function fn() {
        console.log('一个构造函数')
    }
    const fn1 = new fn()

    const f = new P('张三')
    const f2 = new P2('李四')


</script>

</html>